class Volunteer {
  String firstName
  String lastName
  String email
  String password

  static mapping = {
    cache true
  }

  static constraints = {
    firstName(blank: false)
    lastName(blank: false)
    email(blank: false, unique: true, email: true)
    password(blank: false)
  }


  String toString() {
    "${firstName} ${lastName}"
  }

  boolean equals(o) {
    if (this.is(o)) return true;
    if (!o || getClass() != o.class) return false;

    Volunteer volunteer = (Volunteer) o;

    if (firstName != volunteer.firstName) return false;
    if (lastName != volunteer.lastName) return false;
    if (email != volunteer.email) return false;
    if (password != volunteer.password) return false;

    return true;
  }

  int hashCode() {
    int result;
    result = (firstName ? firstName.hashCode() : 0);
    result = 31 * result + (lastName ? lastName.hashCode() : 0);
    result = 31 * result + (email ? email.hashCode() : 0);
    result = 31 * result + (password ? password.hashCode() : 0);
    return result;
  }
}
